package app.beit.fintrack.service.convert;

import java.util.ArrayList;
import java.util.List;

import app.beit.fintrack.bean.ZoneBean;
import app.beit.fintrack.entity.Zone;

public class ZoneConvert {

	/**
	 * Convert Entity To Bean
	 * 
	 * @param entity
	 * @return ZoneBean
	 */
	public static ZoneBean entityToBean(final Zone entity) {
		final ZoneBean bean = new ZoneBean();

		bean.setZoneId(entity.getZoneId());
		bean.setZoneName(entity.getZoneName());

		return bean;
	}

	/**
	 * Convert Bean to Entity
	 * 
	 * @param bean
	 * @return Zone
	 */
	public static Zone beanToEntity(final ZoneBean bean){
		final Zone entity = new Zone();

		entity.setZoneId(bean.getZoneId());
		entity.setZoneName(bean.getZoneName());

		return entity;
	}

	/**
	 * Convert List Entity to List Bean
	 * 
	 * @param entities
	 * @return List ZoneBean
	 */
	public static List<ZoneBean> entityToBean(final List<Zone> entities){
		final List<ZoneBean> beans = new ArrayList<ZoneBean>();

		for (final Zone entity : entities) {
			beans.add(ZoneConvert.entityToBean(entity));
		}

		return beans;
	}

	/**
	 * Convert List Bean to List Entity
	 * 
	 * @param beans
	 * @return List Zone
	 */
	public static List<Zone> beanToEntity(final List<ZoneBean> beans){
		final List<Zone> entities = new ArrayList<Zone>();

		for (final ZoneBean bean : beans) {
			entities.add(ZoneConvert.beanToEntity(bean));
		}

		return entities;
	}

}
